package com.tarena.lbs.activity.dao.repository.impl;


import com.tarena.lbs.activity.dao.mapper.ActivityMapper;
import com.tarena.lbs.activity.dao.repository.ActivityRepository;
import com.tarena.lbs.activity.pojo.query.ActivityQuery;
import com.tarena.lbs.activity.pojo.vo.ActivityVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class ActivityRepositoryImpl implements ActivityRepository {
    @Autowired
    private ActivityMapper activityMapper;

    @Override
    public List<ActivityVO> selectAllActivities(ActivityQuery query) {
        log.info("ActivityRepositoryImpl.selectAllActivities() :"+query);
        List<ActivityVO> list = activityMapper.selectAllActivities(query);
        return list;
    }

//    @Override
//    public List<ActivityVO> selectAllActivities(ActivityQuery query) {
//        Wrapper<ActivityVO> wrapper = new QueryWrapper<>();
//        //wrapper
//        log.info("ActivityRepositoryImpl.selectAllActivities() :"+query);
//        List<ActivityVO> list =
//                activityMapper.selectList(wrapper);
//        log.info("ActivityRepositoryImpl.selectAllActivities() :"+list);
//        return list;
//    }
}
